home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 481 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.sprintlink.net!datalytics!news
  2. From: Rob Stewart <stew@datalytics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Visual C++ and the new operator
  5. Date: 4 Jan 1996 17:13:55 GMT
  6. Organization: Datalytics, Inc
  7. Message-ID: <4ch1sj$ldg@gold.datalytics.com>
  8. References: <4bq0fr$clp@zoom2.telepath.com>
  9. NNTP-Posting-Host: pc071.datalytics.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. aslan@soonernet.com (Merciless) wrote:
  16. >Argh!
  17. >
  18. [snip]
  19. >One of the examples uses two new operators: new and delete,
  20. >to replace (sort of) malloc and dealloc.
  21.  
  22. Not "sort of."  They should completely replace calls to malloc 
  23. and free (what's "dealloc?").  In addition to allocating and 
  24. freeing memory, new and delete invoke constructors and 
  25. destructors, respectively.  This is a tremendous boon.
  26.  
  27. >Well good, any thing that
  28. >make dynamic memory allocation easier is a GoodThing(tm) in
  29. >my book
  30.  
  31. They definitely make heap management easier.  On the other 
  32. hand, you're still using pointers and the heap, so you can 
  33. still get in trouble with them.
  34.  
  35. >BUT
  36. >
  37. >Whenever I try to link code that contain new and delete
  38. >I get:
  39. >
  40. >c:\msvc\mfc\lib\mafxcwd.lib(appinit.cpp) : 
  41. >error L2029: 'GETFILETITLE' : unresolved external
  42. [snip]
  43. >c:\msvc\mfc\lib\mafxcwd.lib(dlgclr.cpp) : 
  44. >error L2029: 'CHOOSECOLOR' : unresolved external
  45. >
  46. >
  47. >If I remove new and delete (make the allocations static at
  48. >compile time) this links just swell.
  49. >
  50. [snip]
  51. >
  52. >-Ian Payne
  53. > aslan@soonernet.com
  54. >
  55.  
  56. The identifiers the linker can't find look like yours.  Post 
  57. the offending code and I'll see what I can tell you.
  58.  
  59. -- 
  60. Robert Stewart        | My opinions are usually my own.
  61. Datalytics, Inc.
  62. (513)226-7700
  63. stew@datalytics.com
  64.  
  65.  
  66.